import commom from './conmon.js';
const baseUrl = "https://xunbo.gzxbyjs.com"
const request = (url = '', date = {}, type = 'POST', header = {
	'content-type': 'application/x-www-form-urlencoded',
	'token': commom.getToken()
}) => {
	return new Promise((resolve, reject) => {
		uni.request({
			method: type,
			url: baseUrl + url,
			data: date,
			header: header,
		}).then((response) => {
			let [error, res] = response;
			resolve(res);
		}).catch(error => {
			let [err, res] = error;
			reject(err)
		})
	});
}
export default request
